﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SY.WebApiTool.Model;

namespace SY.WebApiTool.Model.Expand
{
    public class MaterialAnecoo:Material
    {
        private string materialType;
        private string testClass;
        private string type;
        private Decimal thickness;
        private string workOrder;
        private string customerNumber;
        private string backColor;
        private string die;
        private string materialGenerate;
        private string xiaCuiFenLei;

        /// <summary>
        /// 安耐凯用webAPI物料类
        /// </summary>
        /// <param name="name"></param>
        /// <param name="useOrgNo"></param>
        /// <param name="createOrgNo"></param>
        /// <param name="materialType">物料类别</param>
        /// <param name="testClass">测试分类</param>
        /// <param name="type">型号</param>
        /// <param name="thickness">厚度</param>
        /// <param name="workOrder">工单号</param>
        /// <param name="customerNumber">客户编码</param>
        /// <param name="backColor">背胶颜色</param>
        /// <param name="die">DIE别</param>
        /// <param name="materialGenerate">物料生成节点.为物料生成时所处单据名称</param>
        /// <param name="xiaCuiFenLei">下粹分类</param>
        /// <param name="number">物料编码，默认为空，为空时自动使用物料编码规则</param>
        public MaterialAnecoo(string name, string useOrgNo, string createOrgNo, string number = "",string materialType = "", string testClass = "", string type = "", decimal thickness = 0M, string workOrder = "", string customerNumber = "", string backColor = "", string die = "", string materialGenerate = "", string xiaCuiFenLei = "")
            : base(name,useOrgNo,createOrgNo,number)
        {
            this.materialType = materialType;
            this.testClass = testClass;
            this.type = type;
            this.thickness = thickness;
            this.workOrder = workOrder;
            this.customerNumber = customerNumber;
            this.backColor = backColor;
            this.die = die;
            this.materialGenerate = materialGenerate;
            this.xiaCuiFenLei = xiaCuiFenLei;
        }

        public override string JsonData()
        {
            
            string json= base.JsonData();
            json = json.Replace("{MaterialType}", materialType).
                Replace("{TestType}", testClass).
                Replace("{Type}", type).
                Replace("{Thickness}", thickness.ToString()).
                Replace("{WorkOrder}", workOrder).
                Replace("{CustomerNumber}", customerNumber).
                Replace("{BackColor}", backColor).
                Replace("{DIE}", die).
                Replace("{MaterialGenerate}", materialGenerate).
                Replace("{XiaCuiFenLei}", xiaCuiFenLei);

            return json;
        }

    }
}
